package com.laoxu.microservice.productservice.controller;

import com.laoxu.microservice.productservice.pojo.Product;
import com.laoxu.microservice.productservice.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @author: luohanye
 * @create: 2019-10-20
 **/
@RestController
public class ProductController {
    @Autowired
    private ProductService productService;

    /**
     * 对外提供接口服务，查询商品信息
     *
     * @param id
     * @return
     */
    @GetMapping(value = "product/{id}")
    public Product queryProductById(@PathVariable("id") Long id) {
        return this.productService.queryProductById(id);
    }
}
